package clam.apps.adu.metier;

import java.util.ArrayList;

public class Etablissement
{
	
	private static final String	TAG_ID		= "id";
	private static final String	TAG_LIBELLE	= "libelle";
	private static final String	TAG_SITE	= "site";
	private int					id;
	private String				libelle;
	private Site				site;
	
	public Etablissement()
	{
		this.site = new Site();
	}
	
	public Etablissement(int id)
	{
		this.setId(id);
	}
	
	public Etablissement(int id, String libelle, Site site)
	{
		this.setId(id);
		this.setLibelle(libelle);
		this.setSite(site);
	}
	
	public static Etablissement findByLibelle(String $libelle)
	{
		ParserJsonJavaManager pjjm = new ParserJsonJavaManager();
		
		return pjjm.findEtablissementByLibelle($libelle);
	}
	
	public static ArrayList<Etablissement> findAll()
	{
		ParserJsonJavaManager pjjm = new ParserJsonJavaManager();
		
		return pjjm.findAllEtablissement();
	}
	
	/*
	 * (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString()
	{
		return "Etablissement [id=" + this.id + ", libelle=" + this.libelle
				+ ", site=" + this.site.toString() + "]";
	}
	
	public int getId()
	{
		return this.id;
	}
	
	public void setId(Integer id)
	{
		this.id = id;
	}
	
	public String getLibelle()
	{
		return this.libelle;
	}
	
	public void setLibelle(String libelle)
	{
		this.libelle = libelle;
	}
	
	public Site getSite()
	{
		return this.site;
	}
	
	/**
	 * @param site
	 *            the site to set
	 */
	public void setSite(Site site)
	{
		this.site = site;
	}
	
	/**
	 * @return the tagId
	 */
	public static String getTagId()
	{
		return Etablissement.TAG_ID;
	}
	
	/**
	 * @return the tagLibelle
	 */
	public static String getTagLibelle()
	{
		return Etablissement.TAG_LIBELLE;
	}
	
	/**
	 * @return the tagSite
	 */
	public static String getTagSite()
	{
		return Etablissement.TAG_SITE;
	}
}
